
<?php PremiumPress_Header();  ?>


<div class="premiumpress_box premiumpress_box-50 altbox"> 
<div class="premiumpress_boxin"><div class="header"><h3><img src="<?php bloginfo('template_url'); ?>/images/premiumpress/h-ico/up_alt.png" align="absmiddle"> Bulk Category Setup </h3></div>
<form class="fields" style="padding:10px;" method="post" target="_self" <?php if($GLOBALS['sf'] ==1){ ?>onsubmit="UpgradeVIP();return false;"<?php } ?>>
<input name="catme" type="hidden" value="yes" />
<fieldset class="last">
<legend><strong>Bulk Category Setup </strong></legend>
<label>Categories</label>
<small>Creating lots of categories is time consuming, this tools allows you to create lots of categories quickly. Enter a list of categories below, separating each with a comma. Eg. cat1,cat2,cat3</small>
<textarea name="cats" style="height:100px;width:400px;"></textarea><br />
<label>Parent Category</label>
<small>Enter the parent category ID below if you would like the list to be created as sub categories of an existing category.</small><br />
<input name="pcat" type="text" style="width: 100px;" value="0" class="txt" /><br /><br />
<input class="premiumpress_button" type="submit" value="Create Categories" style="color:white;" />
</fieldset>
</form>
</div>

<?php if(PREMIUMPRESS_SYSTEM == "DirectoryPress"){ ?>
<br />
<div class="premiumpress_boxin"><div class="header"><h3><img src="<?php bloginfo('template_url'); ?>/images/premiumpress/h-ico/open%20alt.png" align="absmiddle"> Domz Import Tool </h3></div>
<form class="fields" style="padding:10px;" method="post" target="_self" <?php if($GLOBALS['sf'] ==1){ ?>onsubmit="UpgradeVIP();return false;"<?php } ?>>
<input name="domz" type="hidden" value="yes" />
<fieldset class="last">
<legend><strong>Domz Import </strong></legend>
 
<table class="maintable">

 
	<tr class="mainrow">
		<td class="titledesc">DMOZ Link</td>
		<td class="forminp">
			<input type="text" name="domz_link" value=""><br />
			<small>Select the link from the dmoz website to extract the contet, example: http://www.dmoz.org/Arts/Animation/</small>

		</td>
	</tr>

	<tr class="mainrow">
		<td class="titledesc">Parent Category</td>
		<td class="forminp">
		<?php
		
		$Maincategories= get_categories('use_desc_for_title=1&hide_empty=0&hierarchical=0');
		$Maincatcount = count($Maincategories);				 
		foreach ($Maincategories as $cat) {		
			if($cat->parent ==0){
				print '<input name="import[cat][]" type="checkbox" value="'.$cat->cat_ID.'">' . $cat->cat_name."<br />";
			}else{
				print ' -- <input name="import[cat][]" type="checkbox" value="'.$cat->cat_ID.'">' . $cat->cat_name."<br />";
			} 
		
		}
		
		?>
		</td>
	</tr>

</table>

<input class="premiumpress_button" type="submit" value="Import Now" style="color:white;" />
</fieldset>
</form>
</div>

<?php } ?>
</div> 

<?php if(PREMIUMPRESS_SYSTEM == "DirectoryPress"){ ?>

<div class="premiumpress_box premiumpress_box-50 altbox"> 
<div class="premiumpress_boxin"><div class="header"><h3><img src="<?php bloginfo('template_url'); ?>/images/premiumpress/h-ico/exclamation.png" align="absmiddle"> Broken Link Checker </h3></div>
<form class="fields" style="padding:10px;" method="post" target="_self" <?php if($GLOBALS['sf'] ==1){ ?>onsubmit="UpgradeVIP();return false;"<?php } ?>>
<input name="borken_links" type="hidden" value="yes" />
<fieldset class="last">
<legend><strong>Broken Link Checker </strong></legend>

<?php if(isset($_POST['borken_links'])){ ?>
<table width="100%"  border="0">
  <tr style="background:#666; height:30px;">
    <td style="color:#fff; width:55px; text-align:center;">&nbsp;ID</td>
    <td style="color:#fff;">&nbsp;Title / Link</td>
    <td style="color:#fff;">&nbsp;Edit</td>
  </tr>
<?php
global $wpdb;
$SQL = "SELECT $wpdb->posts.post_title, $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->postmeta.*
		FROM $wpdb->posts, $wpdb->postmeta
		WHERE $wpdb->postmeta.meta_key ='url' AND ( $wpdb->posts.ID = $wpdb->postmeta.post_id )	";
 
$result = mysql_query($SQL);
while ($row = mysql_fetch_assoc($result)) { 
$error =  checkDomainAvailability($row['meta_value']);
if($error != 1){
?>
  <tr>
    <td style="text-align:center;"><?php echo $row['ID']; ?></td>
    <td><?php echo $row['post_title']; ?> <br /> <?php echo $error; ?> <a href="<?php echo $row['meta_value']; ?>" target="_blank">+</a></td>
    <td><a href="post.php?action=edit&post=<?php echo $row['ID']; ?>">Edit</a></td>
  </tr>
<?php } } ?>
</table>

<?php }else{ ?>
<input class="premiumpress_button" type="submit" value="Check for broken links" style="color:white;" />
<?php } ?>
</fieldset>
</form>
</div></div> 

 

<?php } ?>
 



<div class="premiumpress_box premiumpress_box-50"> 
<div class="premiumpress_boxin"><div class="header"><h3><img src="<?php bloginfo('template_url'); ?>/images/premiumpress/h-ico/copy%20doc.png" align="absmiddle"> CSV File Import</h3></div>
<form class="fields" method="post" target="_self" enctype="multipart/form-data" <?php if($GLOBALS['sf'] ==1){ ?>onsubmit="UpgradeVIP();return false;"<?php } ?> style="padding:10px;">
<input name="csvimport" type="hidden" value="yes" />
<fieldset class="last">
<legend><strong>CSV File Import Options</strong></legend>
<label>Select CVS File</label>
<input type="file" name="import" class="input">
<label>Import Type</label>
<select  class="input" name="type"><option value="posts" selected>Wordpress Posts</option><option value="users">Wordpress Members</option></select>
<label>Column Delimiter</label>
<input name="del" type="text" class="txt"  value="," size="5">
<label>Enclosure</label>
<input name="enc" type="text" class="txt"  value="/" size="5">
<label>Document Column Headings</label>
<select  class="input" name="heading"><option value="yes">Yes</option><option value="no" selected>No</option></select>
<label>Remove Quotes</label>
<select  class="input" name="rq"><option value="yes">Yes</option><option value="no" selected>No</option></select>
<label>Add to Category</label>
<div style="background:#eee; padding:8px;">
<?php
		
		$Maincategories= get_categories('use_desc_for_title=1&hide_empty=0&hierarchical=0');
		$Maincatcount = count($Maincategories);	
			 
		foreach ($Maincategories as $cat) {

			if($cat->parent ==0){
				print '<input name="csv[cat][]" type="checkbox" value="'.$cat->cat_ID.'">' . $cat->cat_name."<br />";
			}else{
				print ' -- <input name="csv[cat][]" type="checkbox" value="'.$cat->cat_ID.'">' . $cat->cat_name."<br />";
			} 
		
		}
		
		?>
	</div>	 
		<br />
			<small>Select one or more categories to import these products into.</small>
<input class="premiumpress_button" type="submit" value="<?php _e('Save changes','cp')?>" style="color:white;" />
</fieldset>
</form>
</div></div> 



<div class="clearfix"></div>  